package com.xinsoft.controller.sale;

import com.xinsoft.common.ApprovedParam;
import com.xinsoft.common.Response;
import com.xinsoft.entity.dto.ApproveDTO;
import com.xinsoft.service.ApproveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/scm/approve")
public class ApproveController {

    @Autowired
    private ApproveService approveService;

    /**
     * 提交审批
     * @param approveDTO
     * @return {@link Response}<{@link ?}>
     */
    @PostMapping("/submitApprove")
    public Response<?> submitApprove(@RequestBody ApproveDTO approveDTO){
        approveService.submitApprove(approveDTO);
        return Response.succeed();
    }

    /**
     * 审批
     */
    @PostMapping("/approved")
    public Response<?> approved(@Validated @RequestBody ApprovedParam param){
        return Response.succeed();
    }
}
